home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_07_08
/
v7n8074a.txt
< prev
next >
Wrap
Text File
|
1989-10-01
|
1KB
|
54 lines
*****Listing 5*****
typedef ... table;
#define TABLE_SIZE 500
table data_1[TABLE_SIZE] = { ... };
void compute_it(...)
{
unsigned short data_1_sum
= compute_checksum(data_1, sizeof(data_1));
...
proc_1();
check_checksum("after proc_1: data_1",
data_1,sizeof(data_1),
data_1_sum);
...
proc_2();
check_checksum("after proc_2: data_1",
data_1,sizeof(data_1),
data_1_sum);
/*
We are going to now modify data_1
in a way we know is correct
*/
modify_table(data_1,...);
data_1_sum =
compute_checksum(data_1, sizeof(data_1));
...
proc_3();
check_checksum("after proc_3: data_1",
data_1,sizeof(data_1),
data_1_sum);
}
**********